import java.util.concurrent.PriorityBlockingQueue;

class Task implements Comparable <Task>{
    //具体的时间要干啥
    private  long time;
    //具体的任务
    private Runnable runnable;
    public Task(Runnable runnable, long delay) {
        this.runnable = runnable;
        this.time=System.currentTimeMillis()+delay;
    }
   public void run(){
        runnable.run();
   }
    public long getTime() {
        return time;
    }
    @Override
    public int compareTo(Task o) {
        return (int)(this.time-o.time);
    }
}
class  Timer{
    //存放多个线程
    private PriorityBlockingQueue<Task> queue=new PriorityBlockingQueue<>();
   public  void schedule(Runnable runnable,long delay){
       Task task=new Task(runnable,delay);
       queue.put(task);
   }

}
public class TimerTask {

}
